package com.ls.controller.holidaycategory;

import com.ls.controller.holidaycategory.model.AddCategoryModel;
import com.ls.controller.holidaycategory.model.EditCategoryModel;
import com.ls.controller.holidaycategory.model.GetCategoryModel;
import com.ls.controller.template.model.QueryTemplateModel;
import com.ls.service.IHolidayCategoryService;
import com.ls.utils.ResultData;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @ClassName HolidayCategoryAppController
 * @Description app节假日分类
 *
 * @author pengyu
 * @since 2024-06-28
 */
@Api(value = "app节假日分类", tags = "app节假日分类")
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/holidayCategoryApp")
public class HolidayCategoryAppController {
    private final IHolidayCategoryService service;

    /** 新增节假日分类  */
    @PostMapping("add")
    public ResultData add(@Valid @RequestBody AddCategoryModel model) {
        return service.add(model);
    }
    /** 更新节假日分类  */
    @PostMapping("edit")
    public ResultData edit(@Valid @RequestBody EditCategoryModel model) {
        return service.edit(model);
    }

    /** 删除节假日分类 */
    @PostMapping("del")
    public ResultData del(@RequestParam Long categoryId) {
        return service.del(categoryId);
    }

    /** 查询节假日分类 */
    @GetMapping("getCategory")
    public ResultData getCategory(GetCategoryModel model) {
        return service.getCategoryApp(model);
    }
    /** 查询节假日分类能否删除 */
    @GetMapping("getCategoryStatus")
    public ResultData getCategoryStatus(@RequestParam Long categoryId) {
        return service.getCategoryStatus(categoryId);
    }
    /** 获取分类详情 */
    @GetMapping("getDetail")
    public ResultData getDetail(@RequestParam Long categoryId) {
        return service.getCategoryDetail(categoryId);
    }
}
